<?php
    apf_require_class("PageHelper");
    $img_path = '/img/home/';
    ?>

<div class="header">
    <div class="bg_top"></div>
    <div class="logo"></div>
</div>

<div class="container">
    <h3>辞退员工录入</h3>
    <form id="form1" action="" method="post">

        <ul>
            <li>
                <label>姓名<em>*</em>：</label>
                <input type="text" id="ipt_name" value="<?=$data['user_data']['user_name']?>" name="user_name" class="auto_sear {required:true,messages:{required:'&nbsp;&nbsp;请选择姓名！'}}"  />
                <input type="hidden" class="leader_id" name="user_id" value="<?=$data['user_data']['user_id']?>"  />
                <input type="hidden" name="work_city_id" id="work_city_id" value="<?=$data['user_data']['work_city_id']?>"  />
                <input type="hidden" name="job_id" id="job_id" value="<?=$data['user_data']['job_id']?>"  />
            </li>

            <li>
                <label>工号<em>*</em>：</label>
                <input type="text" id="ipt_code" class="auto_sear {required:true,messages:{required:'&nbsp;&nbsp;请选择工号！'}}" name="" value="<?=$data['user_data']['user_code']?>" />
            </li>

            <li>
                <label>职位：</label>
                <input class="readonly" id="ipt_job" type="text" readonly="true" name="" value="<?=$data['user_data']['position_name']?>" />
            </li>

            <li>
                <label>职级：</label>
                <input class="readonly" id="ipt_level" type="text" readonly="true" name="" value="<?php echo empty($data['user_data']['p_level']) ? '' : 'P'.$data['user_data']['p_level']?><?php echo empty($data['user_data']['m_level']) ? '' : 'M'.$data['user_data']['m_level']?>" />
            </li>

            <li>
                <label>部门：</label>
                <input class="readonly" id="ipt_department" type="text" readonly="true" name="" value="<?=$data['user_data']['bu_name'].$data['user_data']['department_name']?>" />
            </li>
            <?php $enter_date = '';
            if(!empty($data['user_data']['enter_date'])){
                $enter_date = date('Y-m-d',strtotime($data['user_data']['enter_date']));
            }
            ?>
            <li>
                <label>入职时间：</label>
                <input class="readonly" id="ipt_entry" type="text" readonly="true" name="" value="<?=$enter_date?>" />
            </li>
            <?php $plan_date = '';
            if(!empty($data['user_data']['enter_date'])){
                $plan_date = date('Y-m-d',strtotime($data['leave_data']['plan_date']));
            }
            ?>
            <li>
                <label>预计离职时间<em>*</em>：</label>
                <input type="text" class="datepicker {required:true,messages:{required:'&nbsp;&nbsp;请填写时间！'}}" name="plan_date" id="entry_date" value="<?=$plan_date?>"  />
            </li>

            <li>
                <label>离职原因<em>*</em>：</label>
                <select name="reason_list" class="{min:1,messages:{min:'&nbsp;&nbsp;请选择离职原因！'}}">
                    <option value="0">请选择</option>
                    <?php foreach($data['reason_list'] as $k=>$val):?>
                    <option value="<?=$k?>" <?php if($k==$data['leave_data']['reason_id']):?>selected<?php endif;?>><?=$val?></option>
                    <?php endforeach;?>
                </select>
            </li>

            <li>
                <label></label>
                <input class="submit" type="submit" value=""/>
                <input type="hidden" value="1" id="hid_submit" name="submit"/>
            </li>

        </ul>
    </form>

    <?php if(!empty($notice) && $notice == "success"){?>
        <label id="msg" style="display: inline-block;position: absolute;color: green;top:97px;right:350px;font-size: 20px;"> 提交成功</label>
    <?php }?>
</div>


<?php $this->script_block_begin(); ?>
<script type="text/javascript">
var url_user = "<?php echo Portal_Urls::ajax_search_user();?>";
</script>
<?php $this->script_block_end(); ?>